/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package toesp.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author satria.sp
 */
@Entity
@Table(name = "asisten")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Asisten.findAll", query = "SELECT a FROM Asisten a")})
public class Asisten implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "asisten_id")
    private Integer asistenId;
    //--------------------------------------------------------------------------
    @Basic(optional = false)
    @Column(name = "tha_id")
    private Integer thaId;
    @Basic(optional = false)
    @Column(name = "mhs_npm")
    private String mhsNpm;
    @Basic(optional = false)
    @Column(name = "kuliah_id")
    private String kuliahId;
    //--------------------------------------------------------------------------
    @JoinColumn(name = "tha_id", referencedColumnName = "tha_id", insertable = false, updatable = false)
    @ManyToOne
    private Tha tha;
    @JoinColumn(name = "mhs_npm", referencedColumnName = "mhs_npm", insertable = false, updatable = false)
    @ManyToOne
    private Mhs mhs;
    @JoinColumn(name = "kuliah_id", referencedColumnName = "kuliah_id", insertable = false, updatable = false)
    @ManyToOne
    private Kuliah kuliah;

    public Asisten() {
    }

    public Asisten(Integer asistenId) {
        this.asistenId = asistenId;
    }

    public Integer getAsistenId() {
        return asistenId;
    }

    public void setAsistenId(Integer asistenId) {
        this.asistenId = asistenId;
    } 

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (asistenId != null ? asistenId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Asisten other = (Asisten) obj;
        if (this.thaId != other.thaId && (this.thaId == null || !this.thaId.equals(other.thaId))) {
            return false;
        }
        if ((this.mhsNpm == null) ? (other.mhsNpm != null) : !this.mhsNpm.equals(other.mhsNpm)) {
            return false;
        }
        if ((this.kuliahId == null) ? (other.kuliahId != null) : !this.kuliahId.equals(other.kuliahId)) {
            return false;
        }
        return true;
    }

    /**
     * @return the thaId
     */
    public Integer getThaId() {
        return thaId;
    }

    /**
     * @param thaId the thaId to set
     */
    public void setThaId(Integer thaId) {
        this.thaId = thaId;
    }

    /**
     * @return the mhsNpm
     */
    public String getMhsNpm() {
        return mhsNpm;
    }

    /**
     * @param mhsNpm the mhsNpm to set
     */
    public void setMhsNpm(String mhsNpm) {
        this.mhsNpm = mhsNpm;
    }

    /**
     * @return the kuliahId
     */
    public String getKuliahId() {
        return kuliahId;
    }

    /**
     * @param kuliahId the kuliahId to set
     */
    public void setKuliahId(String kuliahId) {
        this.kuliahId = kuliahId;
    }

    /**
     * @return the tha
     */
    public Tha getTha() {
        return tha;
    }

    /**
     * @param tha the tha to set
     */
    public void setTha(Tha tha) {
        this.tha = tha;
    }

    /**
     * @return the mhs
     */
    public Mhs getMhs() {
        return mhs;
    }

    /**
     * @param mhs the mhs to set
     */
    public void setMhs(Mhs mhs) {
        this.mhs = mhs;
    }

    /**
     * @return the kuliah
     */
    public Kuliah getKuliah() {
        return kuliah;
    }

    /**
     * @param kuliah the kuliah to set
     */
    public void setKuliah(Kuliah kuliah) {
        this.kuliah = kuliah;
    }
    
}
